<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
		<title>专家预审信息</title>
		<link rel="stylesheet" type="text/css" href="../../css/counter.css">
		<link rel="stylesheet" type="text/css" href="../../css/css.css">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="this is my page">
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">

		<script language="JavaScript" type="text/JavaScript">

  </script>
		<script type="text/javascript" src="../../javascript/jquery.js"></script>
	</head>
	<script type="text/javascript">
  function sumLevelCount(s,i,l,w){
   //=================计算分值*权重 start
  var we=l*w;
  $("#sums"+s).attr("value",we);
  //=================计算分值*权重 end 
  tsums=0;txmsum=0;
  //=================计算分值*权重总和及分数总和 start
  for(i=0;i<5;i++){
  ttsum=$("#sums"+i).val();
  xmsum=$('input[@name="ermList['+i+'].xmfs"][@checked]').val();
  if(ttsum==""||xmsum==""){ttsum=0;xmsum=0;}else { ttsum=ttsum;xmsum=xmsum;}
  tsums=parseFloat(tsums)+parseFloat(ttsum);
  txmsum=parseFloat(txmsum)+parseFloat(xmsum);}
  $("#tsums").attr("value",tsums);
  $("#xmsum").attr("value",txmsum);
   //===============计算分值*权重总和及分数总和 end
  }
   //===================验证评分标准 判断专家打分是否选择就可以
  function checkReview1(){
   pslevel0=$('input[@name="ermList[0].xmfs"][@checked]').val();
   pslevel1=$('input[@name="ermList[1].xmfs"][@checked]').val();
   pslevel2=$('input[@name="ermList[2].xmfs"][@checked]').val();
   pslevel3=$('input[@name="ermList[3].xmfs"][@checked]').val();
   pslevel4=$('input[@name="ermList[4].xmfs"][@checked]').val();
   if(pslevel0==null|pslevel0==""){alert("第1评分标准还没有选择！");return false;}
   if(pslevel1==null|pslevel1==""){alert("第2评分标准还没有选择！");return false;}
   if(pslevel2==null|pslevel2==""){alert("第3评分标准还没有选择！");return false;}
   if(pslevel3==null|pslevel3==""){alert("第4评分标准还没有选择！");return false;}
   if(pslevel4==null|pslevel4==""){alert("第5评分标准还没有选择！");return false;}
  }
  </script>
	<script type="text/javascript">
//===========================选择评分标准
function selectLevel(s,i,w,flag){
if(i==1){
$("#ss"+s).html("9:<input type=radio name=ermList["+s+"].xmfs id=s"+s+""+"9  value=9 onclick=sumLevelCount('"+s+"','"+i+"','9','"+w+"')><br>10:<input type=radio name=ermList["+s+"].xmfs id=s"+s+"10  value=10 onclick=sumLevelCount('"+s+"','"+i+"','10','"+w+"')>");

}else if(i==2){
$("#ss"+s).html("6:<input type=radio name=ermList["+s+"].xmfs id=s"+s+"6 value=6  onclick=sumLevelCount('"+s+"','"+i+"','6','"+w+"')><br>7:<input type=radio name=ermList["+s+"].xmfs  id=s"+s+"7  value=7  onclick=sumLevelCount('"+s+"','"+i+"','7','"+w+"')><br>8:<input type=radio name=ermList["+s+"].xmfs  id=s"+s+"8  value=8 onclick=sumLevelCount('"+s+"','"+i+"','8','"+w+"') >");
}else if(i==3){
$("#ss"+s).html("3:<input type=radio name=ermList["+s+"].xmfs id=s"+s+"3 value=3 onclick=sumLevelCount('"+s+"','"+i+"','3','"+w+"') ><br>4:<input type=radio name=ermList["+s+"].xmfs  id=s"+s+"4 value=4  onclick=sumLevelCount('"+s+"','"+i+"','4','"+w+"')><br>5:<input type=radio name=ermList["+s+"].xmfs id=s"+s+"5 value=5  onclick=sumLevelCount('"+s+"','"+i+"','5','"+w+"')>");
}else if(i==4){
$("#ss"+s).html("1:<input type=radio name=ermList["+s+"].xmfs  id=s"+s+"1  value=1 onclick=sumLevelCount('"+s+"','"+i+"','1','"+w+"') ><br>2:<input type=radio name=ermList["+s+"].xmfs id=s"+s+"2 value=2  onclick=sumLevelCount('"+s+"','"+i+"','2','"+w+"')>");
}
if(flag!=""){
$("#s"+s+""+flag).attr("checked",true);
}
}
</script>
	<body>
	<!-- /admin/review/saveReview1Xm.action -->
		<form action="saveReview1Xm.action" method="post"
			id="form1" onsubmit="return checkReview1()">
			<TABLE cellSpacing="0" cellPadding="0" width="100%" align="center"
				border="0">
				<TBODY>
					<TR>
						<TD>
							<IMG src="../../images/manage/arron1.gif">
							<FONT class="font_lv">项目预审评分表 </FONT>
							<input type="button" value="返回" class="btn1"
							onclick="javascript:history.go(-1)">
						</TD>
					</TR>
				</TBODY>
			</TABLE>
		

			<table width="102%" border="0">
				<tr>
					<td width="7%">
						<strong>项目名称：</strong>
					</td>
					<td width="42%">
						<strong><s:property value="basicinfoModel.name" />
						</strong>
					</td>
					<td width="24%">
						<strong>专利号：<s:property value="basicinfoModel.zlid2" />
						</strong>
					</td>
				</tr>
			</table>
			<table cellSpacing="1" cellPadding="1" width="101%" align="center"
				border="0">
				<tr>
					<td class=line>
						<table width="100%" height="100%" cellSpacing=1 cellPadding=2
							bgcolor="#CCCCCC" border=0>
							<tr>
								<td width="217" align="center"
									background="../../images/manage/title_bg.jpg"
									class="font_12_B_w">
									评价指标
								</td>
								<td width="226" align="center"
									background="../../images/manage/title_bg.jpg"
									class="font_12_B_w">
									指标含义
								</td>
								<td width="65" align="center"
									background="../../images/manage/title_bg.jpg"
									class="font_12_B_w">
									权重
								</td>
								<td colspan="2" align="center"
									background="../../images/manage/title_bg.jpg"
									class="font_12_B_w">
									评分标准
								</td>
								<td width="69" align="center"
									background="../../images/manage/title_bg.jpg"
									class="font_12_B_w">
									专家打分
								</td>
								<td width="109" align="center"
									background="../../images/manage/title_bg.jpg"
									class="font_12_B_w">
									分值*权重
								</td>
							</tr>
							<%
							String check = "";
							%>
							<s:iterator value="xpszbList" id="xps" status="s">


								<input type=hidden name="ermList[${s.index}].xmpszbModel.id"
									value="<s:property value="id" />" />
								<input type=hidden
									name="ermList[${s.index}].basicInfoModel.zlid"
									value="<s:property value="basicinfoModel.zlid" />" />
								<input type=hidden name="ermList[${s.index}].expertModel.fBh"
									value="<s:property value="#session.expertModel.fBh" />">
								<tr bgcolor="#FFFFFF">

									<td rowspan="<s:property value="txfList.size"/>">
										<s:hidden name="ermList[%{#s.index}].id"></s:hidden>

										<strong><s:property value="name" />
										</strong>
									</td>
									<td rowspan="<s:property value="txfList.size"/>">
										&nbsp;&nbsp;&nbsp;
										<s:property value="note" />
									</td>
									<td rowspan="<s:property value="txfList.size"/>" align="center">
										<strong><s:property value="weight" />
										</strong>
									</td>
									<s:subset source="txfList" start="0" count="1">
										<s:iterator>
											<td align="left">

												<s:if test="ermList[${s.index}].xmpsbzModel.id==id">
													<%
													check = "checked";
													%>
										       </s:if>
												<input type="radio"
													name="ermList[${s.index}].xmpsbzModel.id" value="${id}"
													onclick="selectLevel('${s.index}',1,<s:property value="weight"/>,'')"
													<%=check%>>
												<s:property value="name" />
											</td>
											<%
											check = "";
											%>
											<td width="68" align="center">
												<s:property value="score" />
											</td>
										</s:iterator>
									</s:subset>
									<td rowspan="<s:property value="txfList.size"/>">
										<div id="ss${s.index}" align="center">
										</div>
									</td>
									<s:if test="ermList[${s.index}].xmpsbzModel.id==txfList[0].id">
                                    	<script type="text/javascript">
        selectLevel(${s.index},1,<s:property value="weight"/>,<s:property  value="ermList[${s.index}].xmfs" />);
        </script>
        </s:if>
									<td rowspan="<s:property value="txfList.size"/>" align="center">

										<s:textfield name="ermList[%{#s.index}].fzqz" size="6"
											cssClass="id_kuang" theme="simple" id="sums%{#s.index}"
											readonly="true"></s:textfield>
									</td>

								</tr>
		
					
								<%
								check = "";
								%>
								<s:subset source="txfList" start="1">
									<s:iterator status="xpsindex">

										<tr bgcolor="#FFFFFF">
											<td align="left">
												<s:if test="ermList[${s.index}].xmpsbzModel.id==id">
													<%
													check = "checked";
													%>
													<script type="text/javascript">
        selectLevel(${s.index},(${xpsindex.index}+2),<s:property value="weight"/>,<s:property  value="ermList[${s.index}].xmfs" />);
        </script>
												</s:if>

												<input type="radio"
													name="ermList[${s.index}].xmpsbzModel.id" value="${id}"
													onclick="selectLevel('${s.index}',(${xpsindex.index}+2),<s:property value="weight"/>,'')"
													<%=check%>>
												<%
												check = "";
												%>
												<s:property value="name" />
											</td>
											<td align="center">
												<s:property value="score" />
											</td>
										</tr>
									</s:iterator>
								</s:subset>
							</s:iterator>
							<tr bgcolor="#FFFFFF">
								<td align="center">
									<strong>总分</strong>
								</td>
								<td align="center">
									--
								</td>
								<td align="center">
									--
								</td>
								<td colspan="2" align="center">
									--
								</td>
								<td align="center">
									<input type="text" name="xmzf" id="xmsum" value=""
										class="id_kuang" size="8">
								</td>
								<td align="center">
									<input type="text" name="fzqzzf" id="tsums" value=""
										class="id_kuang" size="8">
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>

		
		</form>
	</body>
	<script type="text/javascript">
  if(""!="<s:property value="ermList[0].id" />"){
  sumLevelSum()
  }
   function sumLevelSum(){
   tsums=0;
   txmsum=0;
   //=================计算分值*权重总和及分数总和 start
  for(i=0;i<5;i++){
  ttsum=$("#sums"+i).val();
  xmsum=$('input[@name="ermList['+i+'].xmfs"][@checked]').val();
  
  
     if(ttsum==""||ttsum==null||xmsum==""||xmsum==null){
     ttsum=0;
     xmsum=0;
    }else {
     ttsum=ttsum;
     xmsum=xmsum;
    }
     tsums=parseFloat(tsums)+parseFloat(ttsum);
     txmsum=parseFloat(txmsum)+parseFloat(xmsum);
    
  }
  $("#tsums").attr("value",tsums);
  $("#xmsum").attr("value",txmsum);
 
   //===============计算分值*权重总和及分数总和 end
  }

  </script>

</html>
